using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class TretPlanBalanceMap : EntityTypeConfiguration<TretPlanBalance>
    {
        public TretPlanBalanceMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.CustId)
                .IsRequired()
                .HasMaxLength(6);

            // Table & Column Mappings
            this.ToTable("TretPlanBalances");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.CustId).HasColumnName("CustId");
            this.Property(t => t.TretPlanId).HasColumnName("TretPlanId");
            this.Property(t => t.Balance).HasColumnName("Balance");
        }
    }
}
